//
//  WYCBillFrameModel.m
//  信用卡管理
//
//  Created by 中企互联 on 2017/11/8.
//  Copyright © 2017年 李胜军. All rights reserved.
//

#import "WYCBillFrameModel.h"
#define fourFont [UIFont systemFontOfSize:40 * px]

@implementation WYCBillFrameModel
- (void)setBillmodel:(WYCBillModel *)Billmodel{
    _Billmodel = Billmodel;
    
    //cell的高度
    CGFloat cellW = ScreenWidth;
    
    //topView XYW
    CGFloat topViewX = 0;
    CGFloat topViewY = 0;
    CGFloat topViewW = cellW;
    
    
    CGFloat bigtopViewX = 20 * px;
    CGFloat bigtopViewY = 20 * px;
    CGFloat bigtopViewW = ScreenWidth - 20;
    
    
    //图片
    _imageViewF = CGRectMake(60 * px, 40 * px, 200 * px, 200 * px);
    
    
    //银行昵称
    CGFloat bankNameX = CGRectGetMaxX(_imageViewF);
    CGFloat bankNameY = CGRectGetMaxY(_imageViewF)+40 * px;
    NSString * bankNameStr = [NSString stringWithFormat:@"%@(%@)",Billmodel.bankName,Billmodel.lastNumber];
    CGSize bankNameSize = [bankNameStr sizeWithFont:fourFont];
    _bankNameF =  (CGRect){{bankNameX, bankNameY}, bankNameSize};

    
    
    //姓名
    CGFloat NameX = bigtopViewW;
    CGFloat NameY = bankNameY;
    NSString * NameStr = [NSString stringWithFormat:@"%@",Billmodel.name];
    CGSize NameSize = [NameStr sizeWithFont:fourFont];
    _nameF = (CGRect){{NameX,NameY},NameSize};
    
    
    
    
    
    //天数————————账单日
    CGFloat outbBllDayX = 60 * px;
    CGFloat outbBllDayY = CGRectGetMaxY(_bankNameF) + 100 * px;
    NSString * outbBllDayStr = [NSString stringWithFormat:@"%@ 天后出账单",Billmodel.outbBllDay];
    CGSize outbBllDaySize = [outbBllDayStr sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:55 * px]}];
    _outbBllDayF = (CGRect){{outbBllDayX,outbBllDayY},outbBllDaySize};
    
    _approveF = CGRectMake(topViewW - 350 * px, outbBllDayY, 250 * px, 48 * px);
    
    
    
    
    //几号————————账单日
    CGFloat billDateX = outbBllDayX;
    CGFloat billDateY = CGRectGetMaxY(_outbBllDayF) + 60 * px;
    NSString * billDateStr = [NSString stringWithFormat:@"账单日：%@",Billmodel.billDate];
    CGSize billDateSize = [billDateStr sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:40 * px]}];
    _billDateF = (CGRect){{billDateX,billDateY},billDateSize};
    
    
    //几号————————还款日
    CGFloat dueDateY = billDateY;
    NSString * dueDateStr = [NSString stringWithFormat:@"还款日：%@",Billmodel.dueDate];
    CGSize dueDateSize = [dueDateStr sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:40 * px]}];
    CGFloat dueDateX = topViewW - 120 * px - dueDateSize.width;
    _dueDateF = (CGRect){{dueDateX,dueDateY},dueDateSize};
    CGFloat bigtopViewH = CGRectGetMaxY(_dueDateF) + 60*px;
    
    _bigtopViewF = CGRectMake(bigtopViewX, bigtopViewY, bigtopViewW, bigtopViewH);
    CGFloat topViewH = CGRectGetMaxY(_bigtopViewF) + 40 * px;

    
    _topViewF = CGRectMake(topViewX, topViewY, topViewW, topViewH);
    
    
    _cellHeight = topViewH - 40 * px;
    
}
@end
